package org.scuecsz.utils;

import java.util.Random;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Administrator
 */
public class UtilsTest {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {
        // TODO code application logic here
        //除法测试
//        System.out.println("整除测试"+(132/10));
//        System.out.println("取余测试"+(132%10));
//        System.out.println(getMaxPageNum( 1,10));
//        System.out.println(getLIMITSQL(1,10));
        //clone
//        USER_MAIN userMain=new USER_MAIN();
//        userMain.setID("XXX");
//        USER_MAIN newUserMain=(USER_MAIN) TOProcess.clone(userMain);
//        System.out.println(newUserMain.getID());
        //file
//        FileUtil.copyFile(new File("h:\\test.txt"), new File("f:\\xx\\xxx\\3file.txt"));
//        System.out.println(FileUtil.getFileNameSuffix("中国.gif"));
//        Class objClass=Class.forName("org.scuecsz.model.to.USER_MAIN");
//        System.out.println("objClass"+objClass);
//        Object obj=objClass.newInstance();
//        JavaBeanUtil.setValue(obj, "setID", "1");
//        System.out.println("obj"+JavaBeanUtil.getValue(obj, "getID"));
        
        Random r       = new Random();
        for(int i=1;i<=10;i++){
                System.out.println(r.nextInt(i));
        }
        System.out.println("我".codePointAt(0));
    }
    
    public static int getMaxPageNum(int dataSize,int size){
        int maxPageNum=0;
        maxPageNum=dataSize/size+(0==dataSize%size?0:1);
        return maxPageNum;
    }

    public static String getLIMITSQL(int pageNum,int size){
        if(0==size||pageNum<=0){
            return "";
        }
        int fromIndex=(pageNum-1)*size;
        return " LIMIT " +fromIndex+","+size;
    }
}
